﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PartyModuleNavigationList.aspx.cs" Inherits="SysManage.Module.Menu.PartyModuleNavigationList" %>


<!DOCTYPE html>
<html>
<head runat="server">
    <title></title>
    <style type="text/css">
       
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <f:PageManager ID="PageManager1" AutoSizePanelID="RegionPanel1" runat="server"></f:PageManager>
        <f:RegionPanel ID="RegionPanel1" ShowBorder="false" runat="server">
            <Regions>
                <f:Region ID="Region1" ShowBorder="false" ShowHeader="false" Width="300px" Position="Left" Layout="Fit" BodyPadding="5px" runat="server">
                    <Items>
                        <f:Grid ID="Grid1" runat="server" ShowBorder="true" ShowHeader="false" EnableCheckBoxSelect="false" DataKeyNames="ID"
                            AllowSorting="false" OnSort="Grid1_Sort" SortField="OrderNo" SortDirection=""
                            AllowPaging="false" EnableMultiSelect="false" OnRowCommand="Grid1_RowCommand" OnRowClick="Grid1_RowClick" EnableRowClickEvent="true">
                            <Columns>
                                <f:RowNumberField></f:RowNumberField>
                                <f:BoundField DataField="PageName" SortField="PageName" ExpandUnusedSpace="true" HeaderText="模块名称"></f:BoundField>
                                <f:WindowField ColumnID="editField" TextAlign="Center" Icon="Pencil"
                                    ToolTip="编辑" WindowID="WindowModule"
                                    Title="编辑" DataIFrameUrlFields="ID"
                                    DataIFrameUrlFormatString="~/app/SysManage/Module/Menu/PartyModuleNavigationModuleEdit.aspx?id={0}"
                                    Width="50px" />
                                <f:LinkButtonField ColumnID="deleteField" TextAlign="Center" Icon="Delete"
                                    ToolTip="删除" ConfirmText="确定删除此数据？"
                                    ConfirmTarget="Top" CommandName="Delete" Width="50px">
                                </f:LinkButtonField>
                            </Columns>
                            <Toolbars>
                                <f:Toolbar runat="server" ID="module1">
                                    <Items>
                                        <f:ToolbarFill ID="ToolbarFill2" runat="server">
                                        </f:ToolbarFill>
                                        <f:Button ID="btnModule" runat="server" Icon="Add" EnablePostBack="false" Text="新增模块">
                                        </f:Button>
                                    </Items>
                                </f:Toolbar>


                            </Toolbars>
                        </f:Grid>
                    </Items>
                </f:Region>
                <f:Region ID="Region2" ShowBorder="false" ShowHeader="false" Position="Center" Layout="VBox" BoxConfigAlign="Stretch" BoxConfigPosition="Left" BodyPadding="5px 5px 5px 0" runat="server">
                    <Items>
                        <f:Form ID="Form3" runat="server" Height="36px" BodyPadding="5px" ShowHeader="false" ShowBorder="false" LabelAlign="Right">
                            <Rows>
                                <f:FormRow ID="FormRow2" runat="server">
                                    <Items>
                                        <f:TextBox ID="ttbSearchUser" runat="server" EmptyText="在页面名称中搜索" Label="页面名称" LabelAlign="right" LabelWidth="70px"></f:TextBox>
                                        <f:RadioButtonList ID="rblEnableStatus" Label="启用状态" ColumnNumber="3" runat="server" LabelWidth="70px" LabelAlign="right">
                                            <f:RadioItem Text="全部" Selected="true" Value="all" />
                                            <f:RadioItem Text="启用" Value="enabled" />
                                            <f:RadioItem Text="禁用" Value="disabled" />
                                        </f:RadioButtonList>
                                        <f:Button Margin="0 0 0 5" ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" Icon="SystemSearch"></f:Button>
                                    </Items>
                                </f:FormRow>
                            </Rows>
                        </f:Form>
                        <f:Grid ID="Grid2" runat="server" BoxFlex="1" ShowBorder="true" ShowHeader="false" EnableCheckBoxSelect="true"
                            DataKeyNames="ID" AllowSorting="false"
                            SortField="OrderNo"
                            AllowPaging="true"
                            IsDatabasePaging="true" OnPreDataBound="Grid2_PreDataBound" OnRowCommand="Grid2_RowCommand" OnPageIndexChange="Grid2_PageIndexChange">
                            <Toolbars>
                                <f:Toolbar ID="Toolbar1" runat="server">
                                    <Items>
                                        <f:Button ID="btnDeleteSelected" Icon="Delete" runat="server" ConfirmText="确认要删除选中数据？" Text="删除选中数据" OnClick="btnDeleteSelected_Click">
                                        </f:Button>
                                        <f:ToolbarSeparator runat="server">
                                        </f:ToolbarSeparator>
                                        <f:Button ID="btnChangeEnableUsers" Icon="GroupEdit" EnablePostBack="false" runat="server"
                                            Text="设置启用状态">
                                            <Menu runat="server">
                                                <f:MenuButton ID="btnEnableUsers" OnClick="btnEnable_Click" runat="server" Text="启用选中数据">
                                                </f:MenuButton>
                                                <f:MenuButton ID="btnDisableUsers" OnClick="btnDisable_Click" runat="server"
                                                    Text="禁用选中数据">
                                                </f:MenuButton>
                                            </Menu>
                                        </f:Button>

                                        <f:ToolbarFill ID="ToolbarFill1" runat="server">
                                        </f:ToolbarFill>
                                        <f:Button ID="btnNew" runat="server" Icon="Add" EnablePostBack="false" Text="新增类型">
                                        </f:Button>
                                    </Items>
                                </f:Toolbar>
                            </Toolbars>
                            <PageItems>
                                <f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                                </f:ToolbarSeparator>
                                <f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数：">
                                </f:ToolbarText>
                                <f:DropDownList ID="ddlGridPageSize" Width="80px" AutoPostBack="true" OnSelectedIndexChanged="ddlGridPageSize_SelectedIndexChanged" runat="server">
                                    <f:ListItem Text="10" Value="10"></f:ListItem>
                                    <f:ListItem Text="20" Value="20"></f:ListItem>
                                    <f:ListItem Text="50" Value="50"></f:ListItem>
                                    <f:ListItem Text="100" Value="100"></f:ListItem>
                                </f:DropDownList>
                            </PageItems>
                            <Columns>
                                <f:RowNumberField></f:RowNumberField>
                                <f:BoundField DataField="PageName" ExpandUnusedSpace="true" HeaderText="页面名称"></f:BoundField>
                                <f:BoundField DataField="Category" HeaderText="页面标识" Width="200px"></f:BoundField>
                                <f:BoundField DataField="OrderNo" HeaderText="序号" Width="70px"></f:BoundField>
                                <f:CheckBoxField DataField="Enabled" SortField="Enabled" HeaderText="启用" RenderAsStaticField="true" Width="50px"></f:CheckBoxField>

                                <f:WindowField ColumnID="editField" TextAlign="Center" Icon="Pencil" ToolTip="编辑" WindowID="Window1"
                                    Title="编辑" DataIFrameUrlFields="ID"
                                    DataIFrameUrlFormatString="~/app/SysManage/Module/Menu/PartyModuleNavigationEdit.aspx?id={0}"
                                    Width="50px" />
                                <f:LinkButtonField ColumnID="deleteField" TextAlign="Center" Icon="Delete"
                                    ToolTip="删除" ConfirmText="确定删除此数据？" ConfirmTarget="Top" CommandName="Delete" Width="50px">
                                </f:LinkButtonField>
                            </Columns>
                        </f:Grid>
                    </Items>
                </f:Region>
            </Regions>
        </f:RegionPanel>
        <f:Window ID="Window1" CloseAction="Hide" runat="server" IsModal="true" Hidden="true"
            Target="Top" EnableResize="true" EnableMaximize="true" EnableIFrame="true"
            IFrameUrl="about:blank" Width="750px" Height="300px" OnClose="Window1_Close">
        </f:Window>
        <f:Window ID="WindowModule" CloseAction="Hide" runat="server" IsModal="true"
            Hidden="true" Target="Top" EnableResize="true" EnableMaximize="true"
            EnableIFrame="true" IFrameUrl="about:blank" Width="450px" Height="200px" OnClose="Window2_Close">
        </f:Window>
        <f:HiddenField ID="hdModule" runat="server">
        </f:HiddenField>

        <f:HiddenField ID="hdSelectrowindex" runat="server">
        </f:HiddenField>
    </form>
</body>
</html>
<script src=".././../../../Scripts/jquery.min.js"></script>
<script type="text/javascript">
    var SelectrowindexClientID = '<%= hdSelectrowindex.ClientID %>';

    var gridClientID = '<%= Grid1.ClientID %>';

    function SelectRow() {
        // 增加延迟，等待HiddenField更新完毕
        window.setTimeout(function () {
            var selectFirstRow = F(SelectrowindexClientID);

            $("#" + gridClientID).find('tr[role="row"]').eq(selectFirstRow.getValue()).addClass('x-grid-row-selected');

        }, 200);
    }

    // 页面第一个加载完毕后执行的函数
    F.ready(function () {
        SelectRow();

    });
    function addSelectCss(index) {
        $("#" + gridClientID).find('tr[role="row"]').removeClass('x-grid-row-selected');
        $("#" + gridClientID).find('tr[role="row"]').eq(index).addClass('x-grid-row-selected');
    }
</script>

